{% spaceless %}
<!doctype html> 
<html> 
<head>
	<title>Radio Appz</title>
	<script src="http://www.google.com/jsapi"></script>
	<script type="text/javascript">
		google.load("swfobject", "2.1");
		google.load("jquery", "1.4.2");

        function onYouTubePlayerReady(playerId) {
			ytplayer = document.getElementById("myytplayer");
			ytplayer.addEventListener("onStateChange", "onytplayerStateChange");
			ytplayer.addEventListener("onError", "onytplayerStateChange");
        }

		function onytplayerStateChange(newState){
			if (newState == 0) {
				document.search.submit();
			}
		}
		
		function similar(name){
			document.search.text.value = name;
			document.search.submit();
		}
    </script>
</head>
<body>
	<div style="width:425px;">
		<form action="/" name="search" method="post">
			artist: <input id="srch" type="text" name="text" value="{{ search }}" size="30">
			<input type="submit" value="search">
		</form>
		
		<hr>
		
		<div id="content">

			<div style="margin-bottom:5px;">{{ title }}</div>
	
			<div id="ytapiplayer">
				You need Flash player 8+ and JavaScript enabled to view this video.
			</div>
	
			<script type="text/javascript">
				var params = { allowScriptAccess: "always", bgcolor: "#fff" };
				var atts = { id: "myytplayer" };
				swfobject.embedSWF("{{ url }}&version=3&enablejsapi=1&playerapiid=ytplayer&autoplay=1&showinfo=0&rel=0&iv_load_policy=3&cc_load_policy=1", "ytapiplayer", "425", "344", "8", null, null, params, atts);
			</script>
	
			<hr>
			
			<a href="javascript:void(0);" onclick="document.search.submit();">Next >></a>
			
			<hr>
			
			{% for sim in similar %}
				<a href="javascript:void(0);" onclick="similar('{{ sim.item }}')">{{ sim.item }}</a>{% if not forloop.last %}, {% endif %} 
			{% endfor %}
		</div>
		
{% include 'footer.html' %}

{% endspaceless %}